<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>正则表达式</title>
</head>

<body>
	
</body>
<script>
	
	str='linux and sspnp 2 and 3 and 20 and linox and linax lin x php and LINUX and Php and pap and p2p and paaaaaaaap pdp is linxx is lamp p3p';
	
	
	arr=str.match(/p.p(?! is)/ig); //查找除了is之前的pdp,is距离最近的p什么p（取反）
	alert(arr);
</script>
</html>